home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / AppleTalk.p < prev    next >
Text File  |  1996-05-01  |  30KB  |  792 lines

  1. {
  2.      File:        AppleTalk.p
  3.  
  4.      Contains:    AppleTalk Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT AppleTalk;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __APPLETALK__}
  28. {$SETC __APPLETALK__ := 1}
  29.  
  30. {$I+}
  31. {$SETC AppleTalkIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __OSUTILS__}
  38. {$I OSUtils.p}
  39. {$ENDC}
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  46. {
  47.     Real definition of EntityName is 3 PACKED strings of any length (32 is just an example). No
  48.     offests for Asm since each String address must be calculated by adding length byte to last string ptr.
  49.     In Pascal, String(32) will be 34 bytes long since fields never start on an odd byte unless they are 
  50.     only a byte long. So this will generate correct looking interfaces for Pascal and C, but they will not
  51.     be the same, which is OK since they are not used. 
  52. }
  53.  
  54. TYPE
  55.     EntityNamePtr = ^EntityName;
  56.     EntityName = RECORD
  57.         objStr:                    Str32Field;
  58.         typeStr:                Str32Field;
  59.         zoneStr:                Str32Field;
  60.     END;
  61.  
  62.     EntityPtr                            = ^EntityName;
  63.     AddrBlockPtr = ^AddrBlock;
  64.     AddrBlock = PACKED RECORD
  65.         aNet:                    UInt16;
  66.         aNode:                    UInt8;
  67.         aSocket:                UInt8;
  68.     END;
  69.  
  70. {$ENDC}
  71. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  72.  
  73. CONST
  74.                                                                 {  Driver unit and reference numbers (ADSP is dynamic)  }
  75.     mppUnitNum                    = 9;                            {  MPP unit number  }
  76.     atpUnitNum                    = 10;                            {  ATP unit number  }
  77.     xppUnitNum                    = 40;                            {  XPP unit number  }
  78.     mppRefNum                    = -10;                            {  MPP reference number  }
  79.     atpRefNum                    = -11;                            {  ATP reference number  }
  80.     xppRefNum                    = -41;                            {  XPP reference number  }
  81.                                                                 {  .MPP csCodes  }
  82.     lookupReply                    = 242;                            {  This command queued to ourself  }
  83.     writeLAP                    = 243;                            {  Write out LAP packet  }
  84.     detachPH                    = 244;                            {  Detach LAP protocol handler  }
  85.     attachPH                    = 245;                            {  Attach LAP protocol handler  }
  86.     writeDDP                    = 246;                            {  Write out DDP packet  }
  87.     closeSkt                    = 247;                            {  Close DDP socket  }
  88.     openSkt                        = 248;                            {  Open DDP socket  }
  89.     loadNBP                        = 249;                            {  Load NBP command-executing code  }
  90.     lastResident                = 249;                            {  Last resident command  }
  91.     confirmName                    = 250;                            {  Confirm name  }
  92.     lookupName                    = 251;                            {  Look up name on internet  }
  93.     removeName                    = 252;                            {  Remove name from Names Table  }
  94.     registerName                = 253;                            {  Register name in Names Table  }
  95.     killNBP                        = 254;                            {  Kill outstanding NBP request  }
  96.  
  97.     unloadNBP                    = 255;                            {  Unload NBP command code  }
  98.     setSelfSend                    = 256;                            {  MPP: Set to allow writes to self  }
  99.     SetMyZone                    = 257;                            {  Set my zone name  }
  100.     GetATalkInfo                = 258;                            {  get AppleTalk information  }
  101.     ATalkClosePrep                = 259;                            {  AppleTalk close query  }
  102.                                                                 {  .ATP csCodes  }
  103.     nSendRequest                = 248;                            {  NSendRequest code  }
  104.     relRspCB                    = 249;                            {  Release RspCB  }
  105.     closeATPSkt                    = 250;                            {  Close ATP socket  }
  106.     addResponse                    = 251;                            {  Add response code | Require open skt  }
  107.     sendResponse                = 252;                            {  Send response code  }
  108.     getRequest                    = 253;                            {  Get request code  }
  109.     openATPSkt                    = 254;                            {  Open ATP socket  }
  110.     sendRequest                    = 255;                            {  Send request code  }
  111.     relTCB                        = 256;                            {  Release TCB  }
  112.     killGetReq                    = 257;                            {  Kill GetRequest  }
  113.     killSendReq                    = 258;                            {  Kill SendRequest  }
  114.     killAllGetReq                = 259;                            {  Kill all getRequests for a skt  }
  115.                                                                 {  .XPP csCodes  }
  116.     openSess                    = 255;                            {  Open session  }
  117.     closeSess                    = 254;                            {  Close session  }
  118.     userCommand                    = 253;                            {  User command  }
  119.  
  120.     userWrite                    = 252;                            {  User write  }
  121.     getStatus                    = 251;                            {  Get status  }
  122.     afpCall                        = 250;                            {  AFP command (buffer has command code)  }
  123.     getParms                    = 249;                            {  Get parameters  }
  124.     abortOS                        = 248;                            {  Abort open session request  }
  125.     closeAll                    = 247;                            {  Close all open sessions  }
  126.     xCall                        = 246;                            {  .XPP extended calls  }
  127.                                                                 {  Transition Queue transition types  }
  128.     ATTransOpen                    = 0;                            { AppleTalk has opened }
  129.     ATTransClose                = 2;                            { AppleTalk is about to close }
  130.     ATTransClosePrep            = 3;                            { Is it OK to close AppleTalk ? }
  131.     ATTransCancelClose            = 4;                            { Cancel the ClosePrep transition }
  132.     afpByteRangeLock            = 1;                            { AFPCall command codes }
  133.     afpVolClose                    = 2;                            { AFPCall command codes }
  134.     afpDirClose                    = 3;                            { AFPCall command codes }
  135.     afpForkClose                = 4;                            { AFPCall command codes }
  136.     afpCopyFile                    = 5;                            { AFPCall command codes }
  137.     afpDirCreate                = 6;                            { AFPCall command codes }
  138.     afpFileCreate                = 7;                            { AFPCall command codes }
  139.     afpDelete                    = 8;                            { AFPCall command codes }
  140.     afpEnumerate                = 9;                            { AFPCall command codes }
  141.  
  142.     afpFlush                    = 10;                            { AFPCall command codes }
  143.     afpForkFlush                = 11;                            { AFPCall command codes }
  144.     afpGetDirParms                = 12;                            { AFPCall command codes }
  145.     afpGetFileParms                = 13;                            { AFPCall command codes }
  146.     afpGetForkParms                = 14;                            { AFPCall command codes }
  147.     afpGetSInfo                    = 15;                            { AFPCall command codes }
  148.     afpGetSParms                = 16;                            { AFPCall command codes }
  149.     afpGetVolParms                = 17;                            { AFPCall command codes }
  150.     afpLogin                    = 18;                            { AFPCall command codes }
  151.     afpContLogin                = 19;                            { AFPCall command codes }
  152.     afpLogout                    = 20;                            { AFPCall command codes }
  153.     afpMapID                    = 21;                            { AFPCall command codes }
  154.     afpMapName                    = 22;                            { AFPCall command codes }
  155.     afpMove                        = 23;                            { AFPCall command codes }
  156.     afpOpenVol                    = 24;                            { AFPCall command codes }
  157.     afpOpenDir                    = 25;                            { AFPCall command codes }
  158.     afpOpenFork                    = 26;                            { AFPCall command codes }
  159.     afpRead                        = 27;                            { AFPCall command codes }
  160.     afpRename                    = 28;                            { AFPCall command codes }
  161.     afpSetDirParms                = 29;                            { AFPCall command codes }
  162.  
  163.     afpSetFileParms                = 30;                            { AFPCall command codes }
  164.     afpSetForkParms                = 31;                            { AFPCall command codes }
  165.     afpSetVolParms                = 32;                            { AFPCall command codes }
  166.     afpWrite                    = 33;                            { AFPCall command codes }
  167.     afpGetFlDrParms                = 34;                            { AFPCall command codes }
  168.     afpSetFlDrParms                = 35;                            { AFPCall command codes }
  169.     afpDTOpen                    = 48;                            { AFPCall command codes }
  170.     afpDTClose                    = 49;                            { AFPCall command codes }
  171.     afpGetIcon                    = 51;                            { AFPCall command codes }
  172.     afpGtIcnInfo                = 52;                            { AFPCall command codes }
  173.     afpAddAPPL                    = 53;                            { AFPCall command codes }
  174.     afpRmvAPPL                    = 54;                            { AFPCall command codes }
  175.     afpGetAPPL                    = 55;                            { AFPCall command codes }
  176.     afpAddCmt                    = 56;                            { AFPCall command codes }
  177.     afpRmvCmt                    = 57;                            { AFPCall command codes }
  178.     afpGetCmt                    = 58;                            { AFPCall command codes }
  179.     afpAddIcon                    = 192;                            { Special code for ASP Write commands }
  180.     xppLoadedBit                = 5;                            {  XPP bit in PortBUse  }
  181.     scbMemSize                    = 192;                            {  Size of memory for SCB  }
  182.     xppFlagClr                    = 0;                            {  Cs for AFPCommandBlock  }
  183.  
  184.     xppFlagSet                    = 128;                            {  StartEndFlag & NewLineFlag fields.  }
  185.     lapSize                        = 20;
  186.     ddpSize                        = 26;
  187.     nbpSize                        = 26;
  188.     atpSize                        = 56;
  189.     atpXOvalue                    = 32;                            { ATP exactly-once bit  }
  190.     atpEOMvalue                    = 16;                            { ATP End-Of-Message bit  }
  191.     atpSTSvalue                    = 8;                            { ATP Send-Transmission-Status bit  }
  192.     atpTIDValidvalue            = 2;                            { ATP trans. ID valid bit  }
  193.     atpSendChkvalue                = 1;                            { ATP send checksum bit  }
  194.     zipGetLocalZones            = 5;
  195.     zipGetZoneList                = 6;
  196.     zipGetMyZone                = 7;
  197.     LAPMgrPtr                    = $0B18;                        { Entry point for LAP Manager }
  198.     LAPMgrCall                    = 2;                            { Offset to LAP routines }
  199.     LAddAEQ                        = 23;                            { LAPAddATQ routine selector }
  200.     LRmvAEQ                        = 24;                            { LAPRmvATQ routine selector }
  201.  
  202.     tLAPRead                    = 0;
  203.     tLAPWrite                    = 1;
  204.     tDDPRead                    = 2;
  205.     tDDPWrite                    = 3;
  206.     tNBPLookup                    = 4;
  207.     tNBPConfirm                    = 5;
  208.     tNBPRegister                = 6;
  209.     tATPSndRequest                = 7;
  210.     tATPGetRequest                = 8;
  211.     tATPSdRsp                    = 9;
  212.     tATPAddRsp                    = 10;
  213.     tATPRequest                    = 11;
  214.     tATPResponse                = 12;
  215.  
  216.  
  217. TYPE
  218.     ABCallType                            = SInt8;
  219.  
  220. CONST
  221.     lapProto                    = 0;
  222.     ddpProto                    = 1;
  223.     nbpProto                    = 2;
  224.     atpProto                    = 3;
  225.  
  226.  
  227. TYPE
  228.     ABProtoType                            = UInt8;
  229.     ABByte                                = Byte;
  230.     LAPAdrBlockPtr = ^LAPAdrBlock;
  231.     LAPAdrBlock = PACKED RECORD
  232.         dstNodeID:                UInt8;
  233.         srcNodeID:                UInt8;
  234.         lapProtType:            ABByte;
  235.         filler:                    UInt8;                                    {     Filler for proper byte alignment }
  236.     END;
  237.  
  238.     ATQEntryPtr = ^ATQEntry;
  239.     ATalkTransitionEventProcPtr = ProcPtr;  { FUNCTION ATalkTransitionEvent(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr): LONGINT; C; }
  240.  
  241.     ATalkTransitionEventUPP = UniversalProcPtr;
  242.     ATalkTransitionEvent                = ATalkTransitionEventUPP;
  243.     ATQEntry = RECORD
  244.         qLink:                    ATQEntryPtr;                            { next queue entry }
  245.         qType:                    INTEGER;                                { queue type }
  246.         CallAddr:                ATalkTransitionEventUPP;                { your routine descriptor }
  247.     END;
  248.  
  249.     RetransTypePtr = ^RetransType;
  250.     RetransType = PACKED RECORD
  251.         retransInterval:        UInt8;
  252.         retransCount:            UInt8;
  253.     END;
  254.  
  255.     BDSElementPtr = ^BDSElement;
  256.     BDSElement = RECORD
  257.         buffSize:                INTEGER;
  258.         buffPtr:                Ptr;
  259.         dataSize:                INTEGER;
  260.         userBytes:                LONGINT;
  261.     END;
  262.  
  263.     BDSType                                = ARRAY [0..7] OF BDSElement;
  264.     BDSPtr                                = ^BDSElement;
  265.     BitMapType = PACKED ARRAY [0..7] OF BOOLEAN;
  266.     ATLAPRecPtr = ^ATLAPRec;
  267.     ATLAPRec = RECORD
  268.         abOpcode:                ABCallType;
  269.         filler:                    SInt8;                                    {     Filler for proper byte alignment }
  270.         abResult:                INTEGER;
  271.         abUserReference:        LONGINT;
  272.         lapAddress:                LAPAdrBlock;
  273.         lapReqCount:            INTEGER;
  274.         lapActCount:            INTEGER;
  275.         lapDataPtr:                Ptr;
  276.     END;
  277.  
  278.     ATLAPRecHandle                        = ^ATLAPRecPtr;
  279.     ATDDPRecPtr = ^ATDDPRec;
  280.     ATDDPRec = RECORD
  281.         abOpcode:                ABCallType;
  282.         filler:                    SInt8;                                    {     Filler for proper byte alignment }
  283.         abResult:                INTEGER;
  284.         abUserReference:        LONGINT;
  285.         ddpType:                INTEGER;
  286.         ddpSocket:                INTEGER;
  287.         ddpAddress:                AddrBlock;
  288.         ddpReqCount:            INTEGER;
  289.         ddpActCount:            INTEGER;
  290.         ddpDataPtr:                Ptr;
  291.         ddpNodeID:                INTEGER;
  292.     END;
  293.  
  294.     ATDDPRecHandle                        = ^ATDDPRecPtr;
  295.     ATNBPRecPtr = ^ATNBPRec;
  296.     ATNBPRec = RECORD
  297.         abOpcode:                ABCallType;
  298.         filler:                    SInt8;                                    {     Filler for proper byte alignment }
  299.         abResult:                INTEGER;
  300.         abUserReference:        LONGINT;
  301.         nbpEntityPtr:            EntityPtr;
  302.         nbpBufPtr:                Ptr;
  303.         nbpBufSize:                INTEGER;
  304.         nbpDataField:            INTEGER;
  305.         nbpAddress:                AddrBlock;
  306.         nbpRetransmitInfo:        RetransType;
  307.     END;
  308.  
  309.     ATNBPRecHandle                        = ^ATNBPRecPtr;
  310.     ATATPRecPtr = ^ATATPRec;
  311.     ATATPRec = RECORD
  312.         abOpcode:                ABCallType;
  313.         filler1:                SInt8;                                    {     Filler for proper byte alignment }
  314.         abResult:                INTEGER;
  315.         abUserReference:        LONGINT;
  316.         atpSocket:                INTEGER;
  317.         atpAddress:                AddrBlock;
  318.         atpReqCount:            INTEGER;
  319.         atpDataPtr:                Ptr;
  320.         atpRspBDSPtr:            BDSPtr;
  321.         atpBitMap:                SInt8;
  322.         filler2:                SInt8;                                    {     Filler for proper byte alignment }
  323.         atpTransID:                INTEGER;
  324.         atpActCount:            INTEGER;
  325.         atpUserData:            LONGINT;
  326.         atpXO:                    BOOLEAN;
  327.         atpEOM:                    BOOLEAN;
  328.         atpTimeOut:                INTEGER;
  329.         atpRetries:                INTEGER;
  330.         atpNumBufs:                INTEGER;
  331.         atpNumRsp:                INTEGER;
  332.         atpBDSSize:                INTEGER;
  333.         atpRspUData:            LONGINT;
  334.         atpRspBuf:                Ptr;
  335.         atpRspSize:                INTEGER;
  336.     END;
  337.  
  338.     ATATPRecHandle                        = ^ATATPRecPtr;
  339.     AFPCommandBlockPtr = ^AFPCommandBlock;
  340.     AFPCommandBlock = PACKED RECORD
  341.         cmdByte:                UInt8;
  342.         startEndFlag:            UInt8;
  343.         forkRefNum:                INTEGER;
  344.         rwOffset:                LONGINT;
  345.         reqCount:                LONGINT;
  346.         newLineFlag:            UInt8;
  347.         newLineChar:            CHAR;
  348.     END;
  349.  
  350.     MPPPBPtr                            = ^MPPParamBlock;
  351.     ATPPBPtr                            = ^ATPParamBlock;
  352.     XPPParmBlkPtr                        = ^XPPParamBlock;
  353.     MPPCompletionProcPtr = Register68kProcPtr;  { PROCEDURE MPPCompletion(thePBptr: MPPPBPtr); }
  354.  
  355.     ATPCompletionProcPtr = Register68kProcPtr;  { PROCEDURE ATPCompletion(thePBptr: ATPPBPtr); }
  356.  
  357.     XPPCompletionProcPtr = Register68kProcPtr;  { PROCEDURE XPPCompletion(thePBptr: XPPParmBlkPtr); }
  358.  
  359.     AttnRoutineProcPtr = Register68kProcPtr;  { PROCEDURE AttnRoutine(sessRefnum: INTEGER; attnBytes: INTEGER); }
  360.  
  361.     MPPCompletionUPP = UniversalProcPtr;
  362.     ATPCompletionUPP = UniversalProcPtr;
  363.     XPPCompletionUPP = UniversalProcPtr;
  364.     AttnRoutineUPP = UniversalProcPtr;
  365.     WDSElementPtr = ^WDSElement;
  366.     WDSElement = RECORD
  367.         entryLength:            INTEGER;
  368.         entryPtr:                Ptr;
  369.     END;
  370.  
  371.     NTElementPtr = ^NTElement;
  372.     NTElement = RECORD
  373.         nteAddress:                AddrBlock;                                { network address of entity }
  374.         filler:                    SInt8;
  375.         entityData:                ARRAY [0..98] OF SInt8;                    { Object, Type & Zone }
  376.     END;
  377.  
  378.     NamesTableEntryPtr = ^NamesTableEntry;
  379.     NamesTableEntry = RECORD
  380.         qNext:                    Ptr;                                    { ptr to next NTE }
  381.         nt:                        NTElement;
  382.     END;
  383.  
  384.     MPPProtocolHandlerProcPtr = Register68kProcPtr;  { FUNCTION MPPProtocolHandler(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  385.  
  386.     DDPSocketListenerProcPtr = Register68kProcPtr;  { FUNCTION DDPSocketListener(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER): BOOLEAN; }
  387.  
  388.     MPPProtocolHandlerUPP = UniversalProcPtr;
  389.     DDPSocketListenerUPP = UniversalProcPtr;
  390. {
  391.     MPPProtocolHandlerProcs and  DDPSocketListenerProcs cannot be written 
  392.     in or called from a high-level language without the help of mixed mode 
  393.     or assembly glue because they use the following parameter-passing conventions:
  394.  
  395.     typedef Boolean (*MPPProtocolHandlerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2, 
  396.             Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, 
  397.             short numBytesLeftToReadInPacket);
  398.  
  399.         In:
  400.             =>    SCCAddr1                    A0.L
  401.             =>    SCCAddr2                    A1.L
  402.             =>    MPPLocalVars                A2.L
  403.             =>    nextFreeByteInRHA            A3.L
  404.             =>    ReadPacketAndReadRestPtr    A4.L
  405.             =>    numBytesLeftToReadInPacket    D1.W
  406.         Out:
  407.             <=    Boolean                        Z bit of CCR
  408.  
  409.     typedef Boolean (*DDPSocketListenerProcPtr)(Ptr SCCAddr1, Ptr SCCAddr2, 
  410.             Ptr MPPLocalVars, Ptr nextFreeByteInRHA, Ptr ReadPacketAndReadRestPtr, 
  411.             UInt8 packetDestinationNumber, short numBytesLeftToReadInPacket);
  412.  
  413.         In:
  414.             =>    SCCAddr1                    A0.L
  415.             =>    SCCAddr2                    A1.L
  416.             =>    MPPLocalVars                A2.L
  417.             =>    nextFreeByteInRHA            A3.L
  418.             =>    ReadPacketAndReadRestPtr    A4.L
  419.             =>    packetDestinationNumber        D0.B
  420.             =>    numBytesLeftToReadInPacket    D1.W
  421.         Out:
  422.             <=    Boolean                        Z bit of CCR
  423.  
  424. }
  425.     MPPParamBlockPtr = ^MPPParamBlock;
  426.     MPPParamBlock = PACKED RECORD
  427.         qLink:                    QElemPtr;                                { next queue entry }
  428.         qType:                    INTEGER;                                { queue type }
  429.         ioTrap:                    INTEGER;                                { routine trap }
  430.         ioCmdAddr:                Ptr;                                    { routine address }
  431.         ioCompletion:            ATPCompletionUPP;                        { ATPCompletionUPP or MPPCompletionUPP }
  432.         ioResult:                OSErr;                                    { result code }
  433.         userData:                LONGINT;                                { Command result (ATP user bytes) }
  434.         reqTID:                    INTEGER;                                { request transaction ID }
  435.         ioRefNum:                INTEGER;                                { driver reference number }
  436.         csCode:                    INTEGER;                                { Call command code }
  437.         CASE INTEGER OF
  438.         0: (
  439.             filler0:            INTEGER;
  440.             wdsPointer:            Ptr;
  441.            );
  442.         1: (
  443.             protType:            UInt8;
  444.             filler:                SInt8;
  445.             handler:            MPPProtocolHandlerUPP;
  446.            );
  447.         2: (
  448.             socket:                UInt8;
  449.             checksumFlag:        UInt8;
  450.             listener:            DDPSocketListenerUPP;
  451.            );
  452.         3: (
  453.             interval:            UInt8;                                    { retry interval  }
  454.             count:                UInt8;                                    { retry count  }
  455.             nbpPtrs:            Ptr;
  456.             CASE INTEGER OF
  457.             0: (
  458.                 verifyFlag:        UInt8;
  459.                 filler3:        UInt8;
  460.                );
  461.             1: (
  462.                 retBuffPtr:        Ptr;
  463.                 retBuffSize:    INTEGER;
  464.                 maxToGet:        INTEGER;
  465.                 numGotten:        INTEGER;
  466.                );
  467.             2: (
  468.                 confirmAddr:    AddrBlock;
  469.                 newSocket:        UInt8;
  470.                 filler4:        UInt8;
  471.                );
  472.                );
  473.             4: (
  474.                 newSelfFlag:    UInt8;                                    { self-send toggle flag  }
  475.                 oldSelfFlag:    UInt8;                                    { previous self-send state  }
  476.                );
  477.             5: (
  478.                 nKillQEl:        Ptr;                                    { ptr to i/o queue element to cancel  }
  479.                );
  480.             6: (
  481.                 version:        INTEGER;                                { requested info version }
  482.                 varsPtr:        Ptr;                                    { pointer to well known MPP vars }
  483.                 DCEPtr:            Ptr;                                    { pointer to MPP DCE }
  484.                 portID:            INTEGER;                                { port number [0..7] }
  485.                 configuration:    LONGINT;                                { 32-bit configuration word }
  486.                 selfSend:        INTEGER;                                { non zero if SelfSend enabled }
  487.                 netLo:            INTEGER;                                { low value of network range }
  488.                 netHi:            INTEGER;                                { high value of network range }
  489.                 ourAdd:            LONGINT;                                { our 24-bit AppleTalk address }
  490.                 routerAddr:        LONGINT;                                { 24-bit address of (last) router }
  491.                 numOfPHs:        INTEGER;                                { max. number of protocol handlers }
  492.                 numOfSkts:        INTEGER;                                { max. number of static sockets }
  493.                 numNBPEs:        INTEGER;                                { max. concurrent NBP requests }
  494.                 nTQueue:        Ptr;                                    { pointer to registered name queue }
  495.                 LAlength:        INTEGER;                                { length in bytes of data link addr }
  496.                 linkAddr:        Ptr;                                    { data link address returned }
  497.                 zoneName:        Ptr;                                    { zone name returned }
  498.                );
  499.             7: (
  500.                 appName:        Ptr;                                    { pointer to application name in buffer }
  501.                );
  502.     END;
  503.  
  504.     XPPParamBlockPtr = ^XPPParamBlock;
  505.     XPPParamBlock = PACKED RECORD
  506.         qLink:                    QElemPtr;
  507.         qType:                    INTEGER;
  508.         ioTrap:                    INTEGER;
  509.         ioCmdAddr:                Ptr;
  510.         ioCompletion:            XPPCompletionUPP;
  511.         ioResult:                OSErr;
  512.         cmdResult:                LONGINT;
  513.         ioVRefNum:                INTEGER;
  514.         ioRefNum:                INTEGER;
  515.         csCode:                    INTEGER;
  516.         CASE INTEGER OF
  517.         0: (
  518.             abortSCBPtr:        Ptr;                                    {  SCB pointer for AbortOS }
  519.            );
  520.         1: (
  521.             aspMaxCmdSize:        INTEGER;                                { For SPGetParms }
  522.             aspQuantumSize:        INTEGER;
  523.             numSesss:            INTEGER;
  524.            );
  525.         2: (
  526.             sessRefnum:            INTEGER;                                { Offset to session refnum  }
  527.             aspTimeout:            UInt8;                                    { Timeout for ATP  }
  528.             aspRetry:            UInt8;                                    { Retry count for ATP  }
  529.             CASE INTEGER OF
  530.             0: (
  531.                 serverAddr:        AddrBlock;                                { Server address block  }
  532.                 scbPointer:        Ptr;                                    { SCB pointer  }
  533.                 attnRoutine:    AttnRoutineUPP;                            { Attention routine pointer }
  534.                );
  535.             1: (
  536.                 cbSize:            INTEGER;                                { Command block size  }
  537.                 cbPtr:            Ptr;                                    { Command block pointer  }
  538.                 rbSize:            INTEGER;                                { Reply buffer size  }
  539.                 rbPtr:            Ptr;                                    { Reply buffer pointer  }
  540.                 CASE INTEGER OF
  541.                 0: (
  542.                     afpAddrBlock: AddrBlock;                            { block in AFP login  }
  543.                     afpSCBPtr:    Ptr;                                    { SCB pointer in AFP login  }
  544.                     afpAttnRoutine: Ptr;                                { routine pointer in AFP login  }
  545.                    );
  546.                 1: (
  547.                     wdSize:        INTEGER;                                { Write Data size }
  548.                     wdPtr:        Ptr;                                    { Write Data pointer }
  549.                     ccbStart:    PACKED ARRAY [0..295] OF UInt8;            { CCB memory allocated for driver afpWrite max size(CCB)=296 all other calls=150 }
  550.                    );
  551.                    );
  552.                    );
  553.                 3: (
  554.                     xppSubCode:    INTEGER;
  555.                     xppTimeout:    UInt8;                                    { retry interval (seconds) }
  556.                     xppRetry:    UInt8;                                    { retry count }
  557.                     filler1:    INTEGER;
  558.                     zipBuffPtr:    Ptr;                                    { pointer to buffer (must be 578 bytes) }
  559.                     zipNumZones: INTEGER;                                { no. of zone names in this response }
  560.                     zipLastFlag: UInt8;                                    { non-zero if no more zones }
  561.                     filler2:    UInt8;                                    { filler }
  562.                     zipInfoField: PACKED ARRAY [1..70] OF UInt8;        { on initial call, set first word to zero }
  563.                    );
  564.     END;
  565.  
  566.     ATPParamBlockPtr = ^ATPParamBlock;
  567.     ATPParamBlock = PACKED RECORD
  568.         qLink:                    QElemPtr;                                { next queue entry }
  569.         qType:                    INTEGER;                                { queue type }
  570.         ioTrap:                    INTEGER;                                { routine trap }
  571.         ioCmdAddr:                Ptr;                                    { routine address }
  572.         ioCompletion:            ATPCompletionUPP;                        { ATPCompletionUPP or MPPCompletionUPP }
  573.         ioResult:                OSErr;                                    { result code }
  574.         userData:                LONGINT;                                { Command result (ATP user bytes) }
  575.         reqTID:                    INTEGER;                                { request transaction ID }
  576.         ioRefNum:                INTEGER;                                { driver reference number }
  577.         csCode:                    INTEGER;                                { Call command code }
  578.         atpSocket:                UInt8;                                    { currbitmap for requests or ATP socket number }
  579.         atpFlags:                UInt8;                                    { control information }
  580.         addrBlock:                AddrBlock;                                { source/dest. socket address }
  581.         reqLength:                INTEGER;                                { request/response length }
  582.         reqPointer:                Ptr;                                    { ->request/response Data }
  583.         bdsPointer:                Ptr;                                    { ->response BDS  }
  584.         CASE INTEGER OF
  585.         0: (
  586.             numOfBuffs:            UInt8;                                    { numOfBuffs  }
  587.             timeOutVal:            UInt8;                                    { timeout interval  }
  588.             numOfResps:            UInt8;                                    { number of responses actually received  }
  589.             retryCount:            UInt8;                                    { number of retries  }
  590.             intBuff:            INTEGER;                                { used internally for NSendRequest  }
  591.             TRelTime:            UInt8;                                    { TRelease time for extended send request  }
  592.             filler0:            SInt8;
  593.            );
  594.         1: (
  595.             filler:                UInt8;
  596.             bdsSize:            UInt8;                                    { number of BDS elements  }
  597.             transID:            INTEGER;                                { transaction ID recd.  }
  598.            );
  599.         2: (
  600.             bitMap:                UInt8;
  601.             filler2:            UInt8;
  602.            );
  603.         3: (
  604.             rspNum:                UInt8;
  605.             filler3:            UInt8;
  606.            );
  607.         4: (
  608.             aKillQEl:            Ptr;                                    { ptr to i/o queue element to cancel }
  609.            );
  610.     END;
  611.  
  612.  
  613. CONST
  614.     uppATalkTransitionEventProcInfo = $00000FF1;
  615.     uppMPPCompletionProcInfo = $00009802;
  616.     uppATPCompletionProcInfo = $00009802;
  617.     uppXPPCompletionProcInfo = $00009802;
  618.     uppAttnRoutineProcInfo = $00061002;
  619.     uppMPPProtocolHandlerProcInfo = $0000007F;
  620.     uppDDPSocketListenerProcInfo = $0000008F;
  621.  
  622. FUNCTION NewATalkTransitionEventProc(userRoutine: ATalkTransitionEventProcPtr): ATalkTransitionEventUPP;
  623.     {$IFC NOT GENERATINGCFM }
  624.     INLINE $2E9F;
  625.     {$ENDC}
  626.  
  627. FUNCTION NewMPPCompletionProc(userRoutine: MPPCompletionProcPtr): MPPCompletionUPP;
  628.     {$IFC NOT GENERATINGCFM }
  629.     INLINE $2E9F;
  630.     {$ENDC}
  631.  
  632. FUNCTION NewATPCompletionProc(userRoutine: ATPCompletionProcPtr): ATPCompletionUPP;
  633.     {$IFC NOT GENERATINGCFM }
  634.     INLINE $2E9F;
  635.     {$ENDC}
  636.  
  637. FUNCTION NewXPPCompletionProc(userRoutine: XPPCompletionProcPtr): XPPCompletionUPP;
  638.     {$IFC NOT GENERATINGCFM }
  639.     INLINE $2E9F;
  640.     {$ENDC}
  641.  
  642. FUNCTION NewAttnRoutineProc(userRoutine: AttnRoutineProcPtr): AttnRoutineUPP;
  643.     {$IFC NOT GENERATINGCFM }
  644.     INLINE $2E9F;
  645.     {$ENDC}
  646.  
  647. FUNCTION NewMPPProtocolHandlerProc(userRoutine: MPPProtocolHandlerProcPtr): MPPProtocolHandlerUPP;
  648.     {$IFC NOT GENERATINGCFM }
  649.     INLINE $2E9F;
  650.     {$ENDC}
  651.  
  652. FUNCTION NewDDPSocketListenerProc(userRoutine: DDPSocketListenerProcPtr): DDPSocketListenerUPP;
  653.     {$IFC NOT GENERATINGCFM }
  654.     INLINE $2E9F;
  655.     {$ENDC}
  656.  
  657. FUNCTION CallATalkTransitionEventProc(eventCode: LONGINT; qElem: ATQEntryPtr; eventParameter: UNIV Ptr; userRoutine: ATalkTransitionEventUPP): LONGINT;
  658.     {$IFC NOT GENERATINGCFM}
  659.     {To be implemented:  Glue to move parameters into registers.}
  660.     {$ENDC}
  661.  
  662. PROCEDURE CallMPPCompletionProc(thePBptr: MPPPBPtr; userRoutine: MPPCompletionUPP);
  663.     {$IFC NOT GENERATINGCFM}
  664.     {To be implemented:  Glue to move parameters into registers.}
  665.     {$ENDC}
  666.  
  667. PROCEDURE CallATPCompletionProc(thePBptr: ATPPBPtr; userRoutine: ATPCompletionUPP);
  668.     {$IFC NOT GENERATINGCFM}
  669.     {To be implemented:  Glue to move parameters into registers.}
  670.     {$ENDC}
  671.  
  672. PROCEDURE CallXPPCompletionProc(thePBptr: XPPParmBlkPtr; userRoutine: XPPCompletionUPP);
  673.     {$IFC NOT GENERATINGCFM}
  674.     {To be implemented:  Glue to move parameters into registers.}
  675.     {$ENDC}
  676.  
  677. PROCEDURE CallAttnRoutineProc(sessRefnum: INTEGER; attnBytes: INTEGER; userRoutine: AttnRoutineUPP);
  678.     {$IFC NOT GENERATINGCFM}
  679.     {To be implemented:  Glue to move parameters into registers.}
  680.     {$ENDC}
  681.  
  682. FUNCTION CallMPPProtocolHandlerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; numBytesLeftToReadInPacket: INTEGER; userRoutine: MPPProtocolHandlerUPP): BOOLEAN;
  683.     {$IFC NOT GENERATINGCFM}
  684.     {To be implemented:  Glue to move parameters into registers.}
  685.     {$ENDC}
  686.  
  687. FUNCTION CallDDPSocketListenerProc(SCCAddr1: Ptr; SCCAddr2: Ptr; MPPLocalVars: Ptr; nextFreeByteInRHA: Ptr; ReadPacketAndReadRestPtr: Ptr; packetDestinationNumber: ByteParameter; numBytesLeftToReadInPacket: INTEGER; userRoutine: DDPSocketListenerUPP): BOOLEAN;
  688.     {$IFC NOT GENERATINGCFM}
  689.     {To be implemented:  Glue to move parameters into registers.}
  690.     {$ENDC}
  691. FUNCTION OpenXPP(VAR xppRefnum: INTEGER): OSErr;
  692. FUNCTION ASPOpenSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  693. FUNCTION ASPCloseSession(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  694. FUNCTION ASPAbortOS(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  695. FUNCTION ASPGetParms(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  696. FUNCTION ASPCloseAll(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  697. FUNCTION ASPUserWrite(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  698. FUNCTION ASPUserCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  699. FUNCTION ASPGetStatus(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  700. FUNCTION AFPCommand(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  701. FUNCTION GetLocalZones(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  702. FUNCTION GetZoneList(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  703. FUNCTION GetMyZone(thePBptr: XPPParmBlkPtr; async: BOOLEAN): OSErr;
  704. FUNCTION PAttachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  705. FUNCTION PDetachPH(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  706. FUNCTION PWriteLAP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  707. FUNCTION POpenSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  708. FUNCTION PCloseSkt(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  709. FUNCTION PWriteDDP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  710. FUNCTION PRegisterName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  711. FUNCTION PLookupName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  712. FUNCTION PConfirmName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  713. FUNCTION PRemoveName(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  714. FUNCTION PSetSelfSend(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  715. FUNCTION PKillNBP(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  716. FUNCTION PGetAppleTalkInfo(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  717. FUNCTION PATalkClosePrep(thePBptr: MPPPBPtr; async: BOOLEAN): OSErr;
  718. FUNCTION POpenATPSkt(thePBptr: ATPPBPtr; async: BOOLEAN): OSErr;
  719. FUNCTION PCloseATPSkt(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  720. FUNCTION PSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  721. FUNCTION PGetRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  722. FUNCTION PSendResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  723. FUNCTION PAddResponse(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  724. FUNCTION PRelTCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  725. FUNCTION PRelRspCB(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  726. FUNCTION PNSendRequest(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  727. FUNCTION PKillSendReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  728. FUNCTION PKillGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  729. FUNCTION ATPKillAllGetReq(thePBPtr: ATPPBPtr; async: BOOLEAN): OSErr;
  730. PROCEDURE BuildLAPwds(wdsPtr: Ptr; dataPtr: Ptr; destHost: INTEGER; prototype: INTEGER; frameLen: INTEGER);
  731. PROCEDURE BuildDDPwds(wdsPtr: Ptr; headerPtr: Ptr; dataPtr: Ptr; netAddr: AddrBlock; ddpType: INTEGER; dataLen: INTEGER);
  732. PROCEDURE NBPSetEntity(buffer: Ptr; nbpObject: Str32; nbpType: Str32; nbpZone: Str32);
  733. PROCEDURE NBPSetNTE(ntePtr: Ptr; nbpObject: Str32; nbpType: Str32; nbpZone: Str32; socket: INTEGER);
  734. FUNCTION GetBridgeAddress: INTEGER;
  735. FUNCTION BuildBDS(buffPtr: Ptr; bdsPtr: Ptr; buffSize: INTEGER): INTEGER;
  736. FUNCTION MPPOpen: OSErr;
  737. FUNCTION LAPAddATQ(theATQEntry: ATQEntryPtr): OSErr;
  738. FUNCTION LAPRmvATQ(theATQEntry: ATQEntryPtr): OSErr;
  739. FUNCTION ATPLoad: OSErr;
  740. FUNCTION ATPUnload: OSErr;
  741. FUNCTION NBPExtract(theBuffer: Ptr; numInBuf: INTEGER; whichOne: INTEGER; VAR abEntity: EntityName; VAR address: AddrBlock): OSErr;
  742. FUNCTION GetNodeAddress(VAR myNode: INTEGER; VAR myNet: INTEGER): OSErr;
  743. FUNCTION IsMPPOpen: BOOLEAN;
  744. FUNCTION IsATPOpen: BOOLEAN;
  745. PROCEDURE ATEvent(event: LONGINT; infoPtr: Ptr);
  746. FUNCTION ATPreFlightEvent(event: LONGINT; cancel: LONGINT; infoPtr: Ptr): OSErr;
  747. {
  748.     The following routines are obsolete and will not be supported on
  749.     PowerPC. Equivalent functionality is provided by the routines
  750.     above.
  751. }
  752. {$IFC OLDROUTINENAMES AND NOT GENERATINGCFM }
  753. FUNCTION MPPClose: OSErr;
  754. FUNCTION LAPOpenProtocol(theLAPType: ByteParameter; protoPtr: Ptr): OSErr;
  755. FUNCTION LAPCloseProtocol(theLAPType: ByteParameter): OSErr;
  756. FUNCTION LAPWrite(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  757. FUNCTION LAPRead(abRecord: ATLAPRecHandle; async: BOOLEAN): OSErr;
  758. FUNCTION LAPRdCancel(abRecord: ATLAPRecHandle): OSErr;
  759. FUNCTION DDPOpenSocket(VAR theSocket: INTEGER; sktListener: Ptr): OSErr;
  760. FUNCTION DDPCloseSocket(theSocket: INTEGER): OSErr;
  761. FUNCTION DDPRead(abRecord: ATDDPRecHandle; retCksumErrs: BOOLEAN; async: BOOLEAN): OSErr;
  762. FUNCTION DDPWrite(abRecord: ATDDPRecHandle; doChecksum: BOOLEAN; async: BOOLEAN): OSErr;
  763. FUNCTION DDPRdCancel(abRecord: ATDDPRecHandle): OSErr;
  764. FUNCTION ATPOpenSocket(addrRcvd: AddrBlock; VAR atpSocket: INTEGER): OSErr;
  765. FUNCTION ATPCloseSocket(atpSocket: INTEGER): OSErr;
  766. FUNCTION ATPSndRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  767. FUNCTION ATPRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  768. FUNCTION ATPReqCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  769. FUNCTION ATPGetRequest(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  770. FUNCTION ATPSndRsp(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  771. FUNCTION ATPAddRsp(abRecord: ATATPRecHandle): OSErr;
  772. FUNCTION ATPResponse(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  773. FUNCTION ATPRspCancel(abRecord: ATATPRecHandle; async: BOOLEAN): OSErr;
  774. FUNCTION NBPRegister(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  775. FUNCTION NBPLookup(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  776. FUNCTION NBPConfirm(abRecord: ATNBPRecHandle; async: BOOLEAN): OSErr;
  777. FUNCTION NBPRemove(abEntity: EntityPtr): OSErr;
  778. FUNCTION NBPLoad: OSErr;
  779. FUNCTION NBPUnload: OSErr;
  780. {$ENDC}
  781. {$ENDC}
  782. {$ALIGN RESET}
  783. {$POP}
  784.  
  785. {$SETC UsingIncludes := AppleTalkIncludes}
  786.  
  787. {$ENDC} {__APPLETALK__}
  788.  
  789. {$IFC NOT UsingIncludes}
  790.  END.
  791. {$ENDC}
  792.